package com.avic.rong.userOrder;

import android.widget.TextView;

import java.io.File;
import java.net.URI;

/**
 * Created by Administrator on 2016/1/25 0025.
 */
public class MyFile extends File  {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private int fileType;
    private TextView tvBar;


    private int itemType;
    private int spanSize;
    public static final int ITEM_TYPE_PIC_VIDEO = 1;
    public static final int SPAN_SIZE_ONE = 1;
    public static final int ITEM_TYPE_PIC_Btn = 11;

    //图片排序
    private int imgSort;

    public int getImgSort() {
        return imgSort;
    }

    public void setImgSort(int imgSort) {
        this.imgSort = imgSort;
    }

    public TextView getTvBar() {
        return tvBar;
    }

    public void setTvBar(TextView tvBar) {
        this.tvBar = tvBar;
    }

    public int getFileType() {
        return fileType;
    }

    public void setFileType(int fileType) {
        this.fileType = fileType;
    }


    public MyFile(File file, int fileType) {
        super(file.getAbsolutePath());
        this.fileType = fileType;
    }

    public MyFile(File dir, String name, int fileType) {
        super(dir, name);
        this.fileType = fileType;
    }

    public MyFile(String dirPath, String name, int fileType) {
        super(dirPath, name);
        this.fileType = fileType;
    }

    public MyFile(String path, int fileType) {
        super(path);
        this.fileType = fileType;
    }

    public MyFile(URI uri, int fileType) {
        super(uri);
        this.fileType = fileType;
    }

    public int getFileType(File file) {
        if (file.getName().endsWith("userphone_login_icon.png") || file.getName().endsWith(".jpg")) {
            return UploadFile.TYPE_IMAGE;
        } else if (file.getName().endsWith(".mp4")) {
            return UploadFile.TYPE_VIDEO;
        } else if (file.getName().endsWith(".amr")) {
            return UploadFile.TYPE_AUDIO;
        }
        return -1;
    }


    public void setItemType(int itemType) {
        this.itemType = itemType;
    }

    public int getSpanSize() {
        return spanSize;
    }

    public void setSpanSize(int spanSize) {
        this.spanSize = spanSize;
    }



    private boolean isChooseFlagBtn=false;

    public boolean isChooseFlagBtn() {
        return isChooseFlagBtn;
    }

    public void setChooseFlagBtn(boolean chooseFlagBtn) {
        isChooseFlagBtn = chooseFlagBtn;
    }
}
